<template>
	<view class="aboutUs">
		<view class="content">
			<view class="content-edition" @click="editPassword">
				<text class="one">修改密码</text>
				<u-icon name="arrow-right"></u-icon>
			</view>
			<view class="content-edition" @click="exidt">
				<text class="one">退出登录</text>
				<u-icon name="arrow-right"></u-icon>
			</view>
		</view>
		<u-modal :show="show" :content='content' :closeOnClickOverlay="true" :showCancelButton="true"
			@cancel="show = false" @confirm="exditTo"></u-modal>
	</view>
</template>

<script>
export default {
	data() {
		return {
			show: false,
			content: '确定要退出吗？'
		}
	},
	methods: {
		exditTo() {
			if (uni.getStorageSync('token')) {
				uni.clearStorageSync('userId')
				uni.clearStorageSync('token')
				uni.clearStorageSync('companyId')
				uni.clearStorageSync('userINFO')
				uni.navigateTo({
					url: '/pages/login/login'
				})
			}

		},
		exidt() {
			this.show = true

		},
		editPassword() {
			uni.navigateTo({
				url: '/pages/editPassword/editPassword'
			})
		}
	}
}
</script>

<style lang="scss">
.aboutUs {
	width: 100%;
	height: 100%;

	.content {
		width: 100%;
		height: 100vh;
		padding: 40rpx 24rpx;
		background-color: #f6f6f6;

		.content-edition {
			width: 702rpx;
			height: 108rpx;
			margin: 15rpx 0;
			padding: 32rpx 48rpx;
			box-sizing: border-box;
			background-color: #fff;
			border-radius: 16rpx;
			display: flex;
			justify-content: space-between;

			.one {
				font-size: 28rpx;
				color: #666666;
			}
		}
	}
}
</style>
